from django.shortcuts import render

from django.http import HttpResponse
import urllib2
from function.models import Title
from bs4 import BeautifulSoup as bs
from django.shortcuts import HttpResponseRedirect,Http404,HttpResponse,render_to_response
import sqlite3
import crawler
def index(request):
    url="http://baike.baidu.com"
    crawler.catch(url)
    names=Title.objects.all()
    return render_to_response("index.html",locals())
